#import time
#import dailyspents.util as util
#import os
#import cherrypy
#from os.path import join
<html>

#include join(util.HTMLPATH, 'common', 'head.html')

<body>
	<div id="site">
		#include join(util.HTMLPATH, 'common', 'top.html')
		#include join(util.HTMLPATH, 'common', 'menu.html')
		<div id="content">
		  <!-------------------- LEFT SIDE ------------------------->
		  <div id="left">
		    <div class="tl"><div class="tr">
			    statistics
			</div></div>
			
			#include join(util.HTMLPATH, 'common', 'errorMessages.html')
			
			<center style="font-size: 13px; margin-top: 5px;">statistics from <strong>$cherrypy.session['spents'][-1].date</strong> to
			    <strong>$cherrypy.session['spents'][0].date</strong></center>
			
			<div style="padding: 7px; border: 1px solid; margin: 10px;
			    background: url('/static/images/menu-buttom-bg.png')">
				<span style="padding: 2px 10px;">$cherrypy.session.user.settings.currency
				 $total</span>
			</div>
			
			<!-- STATISTICS -->
    			<div class="statistics">
    			    <TABLE width="100%">
    			    <TR>
    			    <TD valign="top">
            			<p>total per category</p>
            			<table>
            			    <th>category</th>
            			    <th>total</th>
            			    <th>percentage</th>
                			#for k, v in $totalPerCategory.items():
                			    <tr>
                			    <td>$k</td>
                			    <td>$v[0]</td> 
                			    <td>
                			        #echo '%.2f' % $v[1]
                			        %
                			    </td>
                			    </tr>
                			#end for
            			</table>
        			</TD>
        			<TD>
        			    #set img = '/static/tmp/category' + $cherrypy.session['_id'] + '.png'
        			    <img src="$img"/> 
        			</TD>
        			</TR>
        			</TABLE>
    			</div>
    			
    			<div class="statistics">
        			<TABLE width="100%">
        			<TR>
        			<TD valign="top">
            			<p>total per payment</p>
            			<table>
            			    <th>payment</th>
            			    <th>total</th>
            			    <th>percentage</th>
            			    #for k, v in $totalPerPayment.items():
                			    <tr>
                			    <td>$k</td>
                			    <td>$v[0]</td> 
                			    <td>
                			        #echo '%.2f' % $v[1]
                			        %
                			    </td>
                			    </tr>
            			    #end for
            			</table>
        			</TD>
        			<TD>
        			    #set img = '/static/tmp/payment' + $cherrypy.session['_id'] + '.png'
        			    <img src="$img"/>
        		    </TD>
        		    </TR>
        		    </TABLE>
        		</div>
            <!-- END OF NEW SPENT FORM -->
            
		  </div>
		  <!-- END OF LEFTSIDE -->
		  <!-- RIGHTSIDE -->
		  <div id="right">
				
			  	#include join(util.HTMLPATH, 'common', 'categories.html')
				#include join(util.HTMLPATH, 'common', 'locals.html')
				#include join(util.HTMLPATH, 'common', 'payments.html')
				
		  </div>
		</div>
		#include join(util.HTMLPATH, 'common', 'bottom.html')
	</div>
</body>

</html>
